package com.zed.api.games;

import java.util.Objects;

/**
 * 游戏实体:
 * - 实现类实现{@link com.zed.api.common.Registration}接口会在结束游戏时候调用改接口,用于释放某些上下文资源
 *
 * @author Zed
 */
public interface Game extends GameBuilderHolder, GameContextService {

    /**
     * 游戏名称
     *
     * @return {@link String}
     */
    String getName();

    /**
     * 判断{@code gameBuilderId}是否跟{@code getGameBuilder()}一致
     *
     * @param gameBuilderId {@link String},游戏构建Id
     * @return {@link boolean},如果是则返回true,狗则返回false
     */
    default boolean isGameBuilder(String gameBuilderId) {
        return Objects.equals(this.getGameBuilder().getId(), gameBuilderId);
    }

    /**
     * 获取游戏关卡
     *
     * @return {@link GameLevels}.一堆游戏关卡
     */
    GameLevels<?, ? extends Action> getGameLevels();

}
